<%@ page import="java.util.List" %>
<%@ page import="com.hxzy.bean.Student" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 9/16
  Time: 17:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="static/bootstrap/css/bootstrap.css" />
</head>
<body>
    <%
        //从请求作用域中获取students集合
        List<Student> students = (List<Student>) request.getAttribute("students");

    %>

    <table class="table table-striped table-hover table-bordered">
        <tr>
            <td>学号</td>
            <td>姓名</td>
            <td>年龄</td>
        </tr>
        <%
            for (Student student : students) {
                //jsp内置对象out在页面中输出tr，td标签以及student对象的属性值
                out.println("\t\t<tr>");
                out.print("\t\t\t<td>");
                out.print(student.getId());
                out.println("</td>");

                out.print("\t\t\t<td>");
                out.print(student.getName());
                out.println("</td>");

                out.print("\t\t\t<td>");
                out.print(student.getAge());
                out.println("</td>");
                out.println("\t\t</tr>");
            }
        %>
    </table>
</body>
</html>
